#ifndef __APPLICATION_COMMANDLINE_H__
#define __APPLICATION_COMMANDLINE_H__

#include <Poco/Thread.h>
#include <Poco/Logger.h>
#include <map>
#include <string>

class CommandLine
{
public:
    CommandLine();
    ~CommandLine();

private:
    static void threadProcedure(void *pContext);

    void handleCommand(const std::string &command);

    void handleExitCommand(std::istream &args);

    CommandLine(const CommandLine &other) = delete;
    CommandLine &operator=(const CommandLine &other) = delete;

private:
    static const std::map<std::string, void (CommandLine::*)(std::istream &)> _commandTable;

    Poco::Logger &_logger;
    Poco::Thread _thread;
    volatile bool _exit;
};

#endif //__APPLICATION_COMMANDLINE_H__
